<div class='fui-page  fui-page-current'>
    <div class="fui-header">
		<div class="title">会员{{pagedata.title}}</div>
	</div>
	<div class='fui-content' style='margin-top:5px;'>
		<div class="fui-cell-group" ng-show="pagedata.item.setting==0">
			<div class="fui-cell must">
				<div class="fui-cell-label">选择{{pagedata.title}}方式</div>
				<label class="fui-cell-label" style="width:30%">
				<input type="radio" value="1" ng-model="pagedata.item.setting"/>验证码{{pagedata.title}}
				</label>
				<label class="fui-cell-label" style="width:30%">
				<input type="radio" value="2" ng-model="pagedata.item.setting"/>账号密码{{pagedata.title}}
				</label>
			</div>
		</div>
		<div class="fui-cell-group" ng-show="pagedata.item.setting==1">
			<div class="fui-cell must">
				<div class="fui-cell-label">手机号</div>
				<div class="fui-cell-info"><input type="text" class='fui-input' placeholder="请输入您的手机号"  ng-model="pagedata.item.mobile" /></div>
				<div class="fui-cell-remark noremark"><a class="btn btn-default btn-default-o btn-sm" ng-click="sendcode()" id="sms_code">获取验证码</a></div>
			</div>
			<div class="fui-cell must ">
				<div class="fui-cell-label ">验证码</div>
				<div class="fui-cell-info"><input type="text" class='fui-input' placeholder="请输入验证码" ng-model="pagedata.item.code" /></div>
			</div>
		</div>
		<div class="fui-cell-group" ng-show="pagedata.item.setting==2">
			<div class="fui-cell must">
				<div class="fui-cell-label">账号</div>
				<div class="fui-cell-info"><input type="text" class='fui-input' placeholder="请输入账号"  ng-model="pagedata.item.username" /></div>
			</div>
			<div class="fui-cell must ">
				<div class="fui-cell-label ">密码</div>
				<div class="fui-cell-info"><input type="pasword" class='fui-input' placeholder="请输入密码" ng-model="pagedata.item.password" /></div>
			</div>
			<div class="fui-cell must ">
				<div class="fui-cell-label ">确认密码</div>
				<div class="fui-cell-info"><input type="pasword" class='fui-input' placeholder="请输入密码" ng-model="pagedata.item.password2" /></div>
			</div>
		</div>
		<a href='javascript:;' ng-show="pagedata.zhuce==0" ng-click="post(pagedata.item,'login')" class='btn btn-success block'>确认登陆</a>
		<a href='javascript:;' ng-show="pagedata.zhuce==1" ng-click="post(pagedata.item,'register')" class='btn btn-success block'>确认注册</a>
		<a href='javascript:;' ng-show="pagedata.zhuce==0" ng-click="pagedata.zhuce=1;pagedata.title='注册'" class='btn btn-success block'>我要注册</a>
		<a href='javascript:;' ng-show="pagedata.zhuce==1" ng-click="pagedata.zhuce=0;;pagedata.title='登陆'" class='btn btn-success block'>返回登陆</a>
	</div>
</div>
<script>
window.scope.sendcode=function(){
	var mobile=window.scope.pagedata.item.mobile;
	if(mobile.length!=11){
		alert('请输入正确的手机号！');
		return false;
	}
	var d=$('#sms_code').text();
	if(d!='重新获取' && d!='获取验证码'){
		return false;
	}
	var postdata={'p':'core','action':'smscode','mobile':mobile};
	window.scope.ajax(postdata,'',function(res){
		if(res=='success'){
			setTimeout(function(){countdown(59);},1000);
		}else{
			window.scope.message('验证码发送失败！');
		}
	});
}
function countdown(start){
		if(start>0){
			$('#sms_code').text(start+'后重新发送');
			start=start-1;
			setTimeout(function(){countdown(start);},1000);
		}else{
			
			$('#sms_code').text('重新获取');
		}
	}
</script>